package com.anysoft.register;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.anysoft.HostConstant;
import com.anysoft.R;
import com.anysoft.base.BaseActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by lty on 2017/9/22.
 */

public class UpLoadIdCardSuccessActivity extends BaseActivity {
    @BindView(R.id.leftButton)
    Button leftButton;
    @BindView(R.id.title)
    TextView title;
    @BindView(R.id.btn_upload_ok)
    Button btn_upload_ok;
    private String name;
    private String id_number, expireDate, operationType;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_idcard_success);
        ButterKnife.bind(this);
        title.setText("上传身份证照片");
        getIntentValue();
        if (!TextUtils.isEmpty(expireDate))
            showConfirmAlert(this, "本次验证通过,验证信息在" + expireDate + "前有效,过期后可重新发起验证");

    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
    }

    private void getIntentValue() {
        Intent intent = getIntent();
        name = intent.getStringExtra("name");
        id_number = intent.getStringExtra("id_number");
        expireDate = intent.getStringExtra("expireDate");
        operationType = intent.getStringExtra("operationType");
    }

    @OnClick({R.id.leftButton, R.id.btn_upload_ok})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.leftButton:
            case R.id.btn_upload_ok: //确定
                Intent intent = new Intent();
                intent.putExtra("name", name);
                intent.putExtra("id_number", id_number);
                setResult(HostConstant.RESULT_UPLOAD_SUCCESS, intent);
                finish();
                break;
        }
    }
}
